import {ADD_NUM, SUB_NUM} from "./constants";

const initailState = {
    name:"cc",
    age:11
}


function userReducer(state = initailState,action){
    switch (action.type){
        case ADD_NUM:
            return {...state,age:state.age+1}
        case SUB_NUM:
            return {...state,age:state.age-1}
        default:
            return state
    }
}


export default userReducer
